#pragma once
#include <bits/types/time_t.h>
#include <cstdarg>
#include <cstdio>
#include<iostream>

#define DEBUG 0
#define NORMAL 1
#define WARNING 2
#define FATAL 3

const char* gLevelMap[]={
    "DEBUG",
    "NORMAL",
    "WARNING",
    "FATAL"
};

void logMessage(int level, const char *format, ...)
{
    if(level==DEBUG){
        return ;
    }
    char stdbuffer[1024];
    time_t Time=time(nullptr);
    snprintf(stdbuffer,sizeof(stdbuffer),"[%s] [%ld]",
    gLevelMap[level],Time);
    char logbuffer[1024];
    va_list args;
    va_start(args, format);
    vsnprintf(logbuffer, sizeof(logbuffer),
    format, args);
    va_end(args);
}
// void logMessage(int level, const char *format, ...)
// {
//     if(level==DEBUG){
//         return ;
//     }
//     char stdbuffer[1024];
//     time_t Time=time(nullptr);
//     snprintf(stdbuffer,sizeof(stdbuffer),"[%s] [%ld]",
//     gLevelMap[level],stdbuffer);
//     char logbuffer[1024];
//     va_list args;
//     va_start(args, format);
//     vsnprintf(logbuffer, sizeof(logbuffer),
//     format, args);
//     printf("%s-%s\n",stdbuffer,logbuffer);
//     va_end(args);
// }

